﻿using Inovout.Cloud.Applications.Security.Models;
using Inovout.Services;
using System;

namespace Inovout.Cloud.Applications.Security.Services
{
    public class BrowserApplicationCredentialService : RepositoryService<BrowserApplicationCredential>, IBrowserApplicationCredentialService
    {
        public override void Save(BrowserApplicationCredential browserApplicationCredential)
        {
            browserApplicationCredential.ApplicationUser.Credentials.Add(browserApplicationCredential);
            browserApplicationCredential.ApiKey = Guid.NewGuid().ToString("N");
            base.Save(browserApplicationCredential);
        }
    }
}
